/*
 * 医务人员诚信查询
 * @author EX-XIEYUWEN001
 * Filename:    IntegrityMedicalController.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014年10月30日
 */
package com.paic.mhis.hcpms.trust.web.controller;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.paic.mhis.common.util.HttpProcessUtil;
import com.paic.mhis.core.auth.biz.service.UserDetails;
import com.paic.mhis.hcpms.trust.biz.service.DoctorIntegrityService;
import com.paic.mhis.hcpms.trust.biz.service.InsuredMedicalApproveService;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityMedicalService;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityWorkFlowService;
import com.paic.mhis.hcpms.trust.dto.IntegrityMedicalDTO;
import com.paic.mhis.hcpms.trust.dto.PointCutDTO;
import com.paic.mhis.hcpms.trust.util.TrustConstants;
import com.paic.mhis.hcpms.trust.web.vo.DoctorIntegrityVO;
import com.paic.mhis.hcpms.trust.web.vo.IntegrityMedicalVO;
import com.paic.mhis.hcpms.trust.web.vo.PointCutVO;
import com.paic.mhis.hcpms.trust.web.vo.TrustUtil;
import com.paic.pafa.app.biz.service.BusinessServiceException;
import com.paic.pafa.appclient.annotation.BizServicesProxy;
import com.paic.pafa.exceptions.BusinessException;

@Controller
@RequestMapping("/doctorIntegrity/")
public class DoctorIntegrityController {
	@BizServicesProxy(beanName = "doctorIntegrityService")
	private DoctorIntegrityService doctorIntegrityService;

	@BizServicesProxy(beanName = "integrityMedicalService")
	private IntegrityMedicalService integrityMedicalService;

	@BizServicesProxy(beanName = "integrityWorkFlowService")
	private IntegrityWorkFlowService integrityWorkFlowService;
	@BizServicesProxy(beanName = "insuredMedicalApproveService")
	private InsuredMedicalApproveService insuredMedicalApproveService;

	/**
	 * 医务人员违规明细查询
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("doctorIllegalDesc.do")
	@ResponseBody
	public Map<String, Object> integrityMedicalDesc(@ModelAttribute PointCutVO search, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		// paramMap.put("targetType", "02");
		// paramMap.put("targetNo", search.getDoctorCode());
		// paramMap.put("orgCode", search.getOrgCode());
		// paramMap.put("caseType", "03");
		// paramMap.put("caseNo", search.getTaskId());
		paramMap.put("caseType", StringUtils.isEmpty(search.getCaseType()) ? null : search.getCaseType());
		paramMap.put("caseNo", StringUtils.isEmpty(search.getCaseNo()) ? null : search.getCaseNo());
		paramMap.put("targetType", StringUtils.isEmpty(search.getTargetType()) ? null : search.getTargetType());
		paramMap.put("targetNo", StringUtils.isEmpty(search.getTargetNo()) ? null : search.getTargetNo());
		paramMap.put("orgCode", StringUtils.isEmpty(search.getOrgCode()) ? null : search.getOrgCode());
		String status = search.getStatus();
		paramMap.put("status", status);
		List<PointCutDTO> pointList = null;
		if (TrustConstants.STATUS_WAIT_MODIFIED.equals(status)) {
			pointList = integrityMedicalService.findPointCutStorageCollections(paramMap);
		} else if (TrustConstants.STATUS_WAIT_AUDIT.equals(status) || TrustConstants.STATUS_WAIT_APPROVE.equals(status)) {
			pointList = integrityMedicalService.findPointCutTemps(paramMap);
		} else {
			pointList = integrityMedicalService.findPointCuts(paramMap);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("result", pointList);
		return map;
	}

	/**
	 * 预警稽核情况次数
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("warnInfoCount.do")
	@ResponseBody
	public Map<String, Object> warnInfoCount(@ModelAttribute DoctorIntegrityVO search, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("targetType", "02");
		paramMap.put("targetNo", search.getDoctorCode());
		paramMap.put("orgCode", search.getOrgCode());
		paramMap.put("caseType", "03");
		paramMap.put("caseNo", search.getDoctorCode());
		String status = search.getStatus();
		paramMap.put("status", status);
		paramMap.put("startDate", search.getStartDate());
		paramMap.put("endDate", search.getEndDate());

		Map<String, Object> map = new HashMap<String, Object>();
		map = doctorIntegrityService.getWarnInfoCount(paramMap);
		return map;
	}

	/**
	 * 诚信审核详情
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("getIntegrityAuditDetail.do")
	@ResponseBody
	public Map<String, Object> getIntegrityAuditDetail(@ModelAttribute DoctorIntegrityVO search,
			HttpServletRequest request) throws BusinessServiceException, BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		paramMap.put("targetType", "02");
		paramMap.put("targetNo", search.getDoctorCode());
		paramMap.put("orgCode", search.getOrgCode());
		paramMap.put("caseType", "03");
		paramMap.put("caseNo", search.getDoctorCode());
		String status = search.getStatus();
		paramMap.put("status", status);
		paramMap.put("taskNo", search.getTaskNo());
		paramMap.put("userName", user.getUsername());
		if (StringUtils.isNotEmpty(search.getUpdatedBy())) {
			paramMap.put("userName", search.getUpdatedBy());
		}
		Map<String, Object> map = new HashMap<String, Object>();
		map = doctorIntegrityService.getIntegrityAuditInfo(paramMap);
		return map;
	}

	/**
	 * 医务人员详情查询列表
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("getIntegrityAuditInfo.do")
	@ResponseBody
	public Map<String, Object> getIntegrityAuditInfo(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		Map<String, Object> result = new HashMap<String, Object>();
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("startDate", search.getStartDate());
		paramMap.put("endDate", search.getEndDate());
		if (StringUtils.isNotEmpty(search.getDoctorCode())) {
			String[] paramStr = search.getDoctorCode().split("\\；\\s*|;\\s*|,\\s*|，\\s*");
			paramMap.put("doctorCode", paramStr);
		} else {
			paramMap.put("doctorCode", null);
		}
		// paramMap.put("doctorCode", search.getDoctorCode());
		if (StringUtils.isNotEmpty(search.getOrgCode())) {
			String[] paramStr = search.getOrgCode().split("\\；\\s*|;\\s*|,\\s*|，\\s*");
			paramMap.put("orgCode", paramStr);
		} else {
			paramMap.put("orgCode", null);
		}
		// paramMap.put("orgCode", search.getOrgCode());
		paramMap.put("actCurrent", search.getActCurrent());
		paramMap.put("start", search.getStart());
		paramMap.put("limit", search.getLimit());
		List<String> statusList = new ArrayList<String>();
		statusList.add(TrustConstants.STATUS_WAIT_AUDIT);
		paramMap.put("userName", user.getUsername());
		paramMap.put("userRole", TrustConstants.INTEGRITY_AUDITING_ROLE);
		paramMap.put("statusList", statusList);
		paramMap.put("nextStatus", TrustConstants.STATUS_WAIT_APPROVE);

		try {
			result = doctorIntegrityService.integrityAuditList(paramMap);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员审核
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("auditConfirm.do")
	@ResponseBody
	public Map<String, Object> auditConfirm(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		// String taskNo = (String) paramMap.get("taskNo");// 任务编号
		// String status = (String) paramMap.get("status");// 当前节点状态
		// String saveStatus = (String) paramMap.get("saveStatus");//
		// 操作状态1.审核，2.审核批量,3.审批,4.审批批量
		// UserDetails user = (UserDetails) paramMap.get("userInfo");// 用户对象
		// String opinion = (String) paramMap.get("integrityOpinion");//
		// 操作状态01.同意，02.不同意
		try {
			String str = HttpProcessUtil.readRequestBody(request);
			JSONObject transferJson = JSON.parseObject(str);
			UserDetails user = (UserDetails) request.getSession().getAttribute("user");
			paramMap.put("taskNo", transferJson.getString("taskNo"));
			paramMap.put("status", transferJson.getString("actCurrent"));
			paramMap.put("saveStatus", transferJson.getString("saveStatus"));
			paramMap.put("userInfo", user);
			paramMap.put("integrityOpinion", transferJson.getString("opinion"));
			// JSONObject transferJson = new JSONObject();
			transferJson.put("opinionType", transferJson.getString("opinionType"));
			transferJson.put("createBy", user.getUsername());
			result = integrityWorkFlowService.resultMapIntegrityAuditApproveWorkFlow(transferJson, paramMap, resultMap);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员批量审核
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("auditBatchConfirm.do")
	@ResponseBody
	public Map<String, Object> auditBatchConfirm(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		// String taskNo = (String) paramMap.get("taskNo");// 任务编号
		// String status = (String) paramMap.get("status");// 当前节点状态
		// String saveStatus = (String) paramMap.get("saveStatus");//
		// 操作状态1.审核，2.审核批量,3.审批,4.审批批量
		// UserDetails user = (UserDetails) paramMap.get("userInfo");// 用户对象
		// String opinion = (String) paramMap.get("integrityOpinion");//
		// 操作状态01.同意，02.不同意
		try {
			String str = HttpProcessUtil.readRequestBody(request);
			JSONObject transferJson = JSON.parseObject(str);
			UserDetails user = (UserDetails) request.getSession().getAttribute("user");
			String taskNo = transferJson.getString("taskNo");
			taskNo = taskNo.substring(0, taskNo.length() - 1);
			String[] taskNoAry = taskNo.split(",");
			for (int i = 0; i < taskNoAry.length; i++) {
				String tempTaskNo = taskNoAry[i];
				paramMap.put("taskNo", tempTaskNo);
				paramMap.put("status", transferJson.getString("actCurrent"));
				paramMap.put("saveStatus", transferJson.getString("saveStatus"));
				paramMap.put("userInfo", user);
				paramMap.put("integrityOpinion", transferJson.getString("opinion"));
				// JSONObject transferJson = new JSONObject();
				// transferJson.put("opinionType", "01");
				transferJson.put("createBy", user.getUsername());
				result = integrityWorkFlowService.resultMapIntegrityAuditApproveWorkFlow(transferJson, paramMap,
						resultMap);
			}
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员详情查询导出
	 * 
	 * @param limit
	 * @param start
	 * @param excelName
	 * @param vo
	 * @param response
	 */
	@RequestMapping("medicalDetailReport.do")
	@ResponseBody
	public void medicalDetailReport(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start,
			@RequestParam(value = "excelName", defaultValue = "medicalDetail") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response) {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		TrustUtil.paramMap(paramMap, vo);
		int total = doctorIntegrityService.getCountMedicalDetailReport(paramMap);
		List<IntegrityMedicalDTO> list = new ArrayList<IntegrityMedicalDTO>();
		if (total > 0) {
			limit = 8000;
			for (int i = 0; i < total;) {
				List<IntegrityMedicalDTO> resultListTemp = doctorIntegrityService.findMedicalDetailReport(limit, i + 1,
						paramMap);
				list.addAll(resultListTemp);
				i += limit;
			}
		} else {
			list = new ArrayList<IntegrityMedicalDTO>();
		}
		String[] str = { "序号", "医生姓名", "身份证号", "机构名称", "机构编号", "机构地址", "执业时间", "违规记分值", "案件编号", "记分原因", "案发时间",
				"暂停医保服务权限时间", "状态" };
		try {
			exportExcel(str, excelName, list, response);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	private void exportExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list,
			HttpServletResponse response) throws IOException {
		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					// 序号、医生姓名、身份证号、机构名称、机构编号、机构地址,执业时间、违规记分值、案件编号、记分原因、案发时间、暂停医保服务权限时间
					row.createCell(0).setCellValue(i + 1);// 序号
					row.createCell(1).setCellValue(dto.getName());// 医生姓名
					row.createCell(2).setCellValue(dto.getCertificateNo());// 身份证号
					row.createCell(3).setCellValue(dto.getHealthcareProviderName());// 机构名称
					row.createCell(4).setCellValue(dto.getHealthcareProviderCode());// 机构编号
					row.createCell(5).setCellValue(dto.getFullAddress());// 机构地址
					row.createCell(6).setCellValue(dto.getQualifiedDate());// 执业时间
					//row.createCell(7).setCellValue(dto.getViolationsScores());// 违规记分值
					row.createCell(7).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
					if(dto.getViolationsScores()!=null&&dto.getViolationsScores()!=""){
						row.getCell(7).setCellValue(Double.parseDouble(dto.getViolationsScores()));
					}
					else{
						row.getCell(7).setCellValue(Double.parseDouble("0.0"));
					}
					row.createCell(8).setCellValue(dto.getCaseNo());// 案件编号
					row.createCell(9).setCellValue(dto.getReason());// 记分原因
					row.createCell(10).setCellValue(dto.getHappenDate());// 案发时间
					row.createCell(11).setCellValue(dto.getSuspendPayExecutionTime());// 暂停医保服务权限时间
					String status = "";
					if (TrustConstants.STATUS_WAIT_AUDIT.equals(dto.getActCurrent())) {
						status = "待审核";
					} else if (TrustConstants.STATUS_WAIT_APPROVE.equals(dto.getActCurrent())) {
						status = "待审批";
					}
					row.createCell(12).setCellValue(status);// 状态
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}

	}

	private void initResponse(HttpServletResponse response, String excelName) {
		try {
			response.addHeader("Pragma", "no-cache");
			response.addHeader("Cache-Control", "no-cache");
			response.reset();
			response.setContentType("APPLICATION/OCTET-STREAM");
			String fileName = new String((excelName).getBytes("utf-8"), "ISO8859-1") + ".xls";
			response.setHeader("content-disposition", "attachment;fileName=\"" + fileName + "\"");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 医务人员审核
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("auditCancel.do")
	@ResponseBody
	public Map<String, Object> auditCancle(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		// String taskNo = (String) paramMap.get("taskNo");// 任务编号
		// String status = (String) paramMap.get("status");// 当前节点状态
		// String saveStatus = (String) paramMap.get("saveStatus");//
		// 操作状态1.审核，2.审核批量,3.审批,4.审批批量
		// UserDetails user = (UserDetails) paramMap.get("userInfo");// 用户对象
		// String opinion = (String) paramMap.get("integrityOpinion");//
		// 操作状态01.同意，02.不同意
		try {
			String str = HttpProcessUtil.readRequestBody(request);
			JSONObject transferJson = JSON.parseObject(str);
			UserDetails user = (UserDetails) request.getSession().getAttribute("user");
			paramMap.put("taskNo", transferJson.getString("taskNo"));
			paramMap.put("userRole", TrustConstants.INTEGRITY_AUDITING_ROLE);
			paramMap.put("actCurrent", TrustConstants.STATUS_WAIT_AUDIT);
			// paramMap.put("status", transferJson.getString("actCurrent"));
			// paramMap.put("saveStatus", transferJson.getString("saveStatus"));
			// paramMap.put("userInfo", user);
			// paramMap.put("integrityOpinion",
			// transferJson.getString("opinion"));
			// // JSONObject transferJson = new JSONObject();
			// transferJson.put("opinionType", TrustConstants.STATUS_AUDIT);
			paramMap.put("updateBy", user.getUsername());
			result = doctorIntegrityService.auditCancle(paramMap);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员审批
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("approveConfirm.do")
	@ResponseBody
	public Map<String, Object> approveConfirm(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		try {
			String str = HttpProcessUtil.readRequestBody(request);
			JSONObject transferJson = JSON.parseObject(str);
			UserDetails user = (UserDetails) request.getSession().getAttribute("user");
			paramMap.put("taskNo", transferJson.getString("taskNo"));
			paramMap.put("status", transferJson.getString("actCurrent"));
			paramMap.put("saveStatus", transferJson.getString("saveStatus"));
			paramMap.put("userInfo", user);
			paramMap.put("integrityOpinion", transferJson.getString("opinion"));
			transferJson.put("opinionType", TrustConstants.OPINION_APPROVE_TYPE);
			transferJson.put("createBy", user.getUsername());
			result = integrityWorkFlowService.resultMapIntegrityAuditApproveWorkFlow(transferJson, paramMap, resultMap);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员审批
	 * 
	 * @param limit
	 * @param start
	 * @param search
	 * @param request
	 * @return 返回查询的集合和总条数
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping(value = "approveBatchConfirm.do", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> approveBatchConfirm(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		// 操作状态01.同意，02.不同意
		try {
			String str = HttpProcessUtil.readRequestBody(request);
			JSONObject transferJson = JSON.parseObject(str);
			UserDetails user = (UserDetails) request.getSession().getAttribute("user");
			String taskNo = transferJson.getString("taskNo");
			taskNo = taskNo.substring(0, taskNo.length() - 1);
			String[] taskNoAry = taskNo.split(",");
			for (int i = 0; i < taskNoAry.length; i++) {
				String tempTaskNo = taskNoAry[i];
				transferJson.put("taskNo", tempTaskNo);
				paramMap.put("taskNo", tempTaskNo);
				paramMap.put("status", transferJson.getString("actCurrent"));
				paramMap.put("saveStatus", transferJson.getString("saveStatus"));
				paramMap.put("userInfo", user);
				paramMap.put("integrityOpinion", transferJson.getString("opinion"));
				// JSONObject transferJson = new JSONObject();
				// transferJson.put("opinionType", "01");
				transferJson.put("createBy", user.getUsername());
				result = integrityWorkFlowService.resultMapIntegrityAuditApproveWorkFlow(transferJson, paramMap,
						resultMap);
			}
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}

		return result;
	}
}
